body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f0f0 60%, #e9e7fa 100%);
    min-height: 100vh;
}

h1 {
    text-align: center;
    letter-spacing: 2px;
    margin-top: 1em;
    font-size: 2.5em;
}

.slogan {
    text-align: center;
    font-style: italic;
    font-size: 1.2em;
    margin-bottom: 0.5em;
    color: #6a7cab;
}

.container {
    display: flex;
    justify-content: space-around;
    gap: 32px;
    padding: 20px;
    margin-top: 2em;
}

.editor-section,
.game-section {
    width: 45%;
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 24px 0 rgba(86,98,155,0.06);
    display: flex;
    flex-direction: column;
    min-width: 340px;
}

#game-preview {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fafafe;
    transition: box-shadow 0.2s;
}

#game-preview:focus-within {
    box-shadow: 0 0 0 3px #cf63bf80;
}

#run-button {
    display: block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
}

#run-button:hover {
    background-color: #3e8e41;
}

#publish-button, #share-button {
    display: block;
    margin-top: 14px;
    padding: 11px 24px;
    background-color: #FFD580;
    color: #222;
    border: none;
    border-radius: 7px;
    font-weight: bold;
    font-size: 1.03em;
    cursor: pointer;
    transition: background .2s;
}

#publish-button:hover, #share-button:hover {
    background-color: #ffe4a1;
}

#sprite-editor {
    border: 1px solid #ccc;
    margin-top: 10px;
    width: 100px;
    height: 100px;
    background: white;
    display: block;
}

#clear-sprite-button {
    display: block;
    margin-top: 10px;
    padding: 9px 20px;
    background-color: #9b51e0;
    color: white;
    border: none;
    border-radius: 7px;
    font-weight: 600;
    cursor: pointer;
}

#clear-sprite-button:hover {
    background: #4a6cd4;
}

.home-button {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 16px;
    background: #337ab7;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 600;
}

.home-button:hover {
    background-color: #235a81;
}

.create-button {
    display: block;
    margin: 26px auto;
    padding: 13px 22px;
    background: #007bff; 
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 7px;
    width: 250px;
    font-weight: 600;
    font-size: 1.23em;
    box-shadow: 0 2px 6px #a1aeea33;
    transition: background 0.2s, box-shadow 0.2s;
}

.create-button:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 16px #7f9dff15;
}

.featured-games,
.new-games {
    margin: 32px 18px 12px 18px;
    padding: 24px 20px 18px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px 0 rgba(180,170,255,0.085);
}

.featured-games h2 {
    color: #FFD580;
    letter-spacing: 1px;
    font-size: 2em;
    margin-bottom: 0.7em;
}
.new-games h2 {
    color: #9b51e0;
    font-size: 2em;
    margin-bottom: 0.7em;
}

.game-list {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 18px;
}

.game-card {
    width: 300px;
    margin: 10px 7px;
    padding: 19px 16px 10px 16px;
    text-decoration: none;
    color: #333;
    background-color: #f9f9fe;
    border-radius: 9px;
    box-shadow: 0 1px 7px rgba(137, 111, 255, 0.09);
    transition: box-shadow 0.18s, background-color 0.18s;
    border: 1px solid #ede5ff;
    cursor: pointer;
}

.game-card:hover, .game-card:focus {
    background-color: #ebeafd;
    box-shadow: 0 8px 22px #dfd4fc33;
}

.game-card h3 {
    margin: 0 0 8px 0;
    font-weight: bold;
    color: #4a6cd4;
    font-size: 1.2em;
    letter-spacing: 0.5px;
}

.game-card .description {
    min-height: 44px;
    color: #666;
    margin-bottom: 0.3em;
    font-size: 1em;
}
.game-actions {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.play-now {
    display: inline-block;
    background: #4a6cd4;
    color: #fff;
    border-radius: 4px;
    padding: 5px 13px;
    text-decoration: none;
    font-weight: 600;
    margin-right: 8px;
    transition: background 0.12s;
}

.play-now:hover { background: #cf63bf; color: #fff;}

.details-button {
    background: #FFD580;
    border: none;
    border-radius: 4px;
    color: #4a6cd4;
    font-weight: 500;
    padding: 6px 13px;
    cursor: pointer;
    font-size: 0.95em;
}

.details-button:hover {
    background: #ffe6af;
    color: #cf63bf;
}

.game-author {
    font-size: 0.97em;
    color: #7950d6;
    font-style: italic;
    margin: 5px 2px 0 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 14;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(77,51,112,0.18);
}

.modal-content {
    position: absolute;
    top: 54%;
    left: 50%;
    transform: translate(-50%, -54%);
    background: linear-gradient(109deg,#fff 80%, #f7edff 100%);
    padding: 32px 36px 28px 36px;
    border-radius: 20px;
    box-shadow: 0 14px 60px #6741bf22;
    width: 420px;
    max-width: 98vw;
    max-height: 90vh;
    overflow-y: auto;
}

.close-button {
    position: absolute;
    top: 11px;
    right: 13px;
    font-size: 28px;
    cursor: pointer;
    color: #b49de4;
    font-weight: 600;
    background: transparent;
    border: none;
}

.close-button:hover {
    color: #cf63bf;
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 18px;
    margin-bottom: -12px;
}

#random-game-button, #refresh-list-button {
    padding: 11px 22px;
    font-size: 1.05em;
    border-radius: 6px;
    background: #9b51e0;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.17s;
    margin: 0;
    box-shadow: 0 2px 7px #c393fa21;
}
#random-game-button:hover, #refresh-list-button:hover {
    background: #4a6cd4;
}

.online-users-section {
    margin: 28px auto 20px auto;
    max-width: 500px;
    background: #f7f7fe;
    border-radius: 8px;
    box-shadow: 0 0px 7px #bfc8ff14;
    padding: 11px 20px 7px 18px;
    text-align: left;
    min-height: 52px;
}
.online-users-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.17em;
    letter-spacing: 1px;
}
#online-users {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.user-peek {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    font-size: 1.01em;
}
.user-peek .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #cf63bf44;
    margin-right: 3px;
}
.game-detail-section {
    padding: 10px 0 0 0;
    margin-bottom: 8px;
    font-size: 1.05em;
}
.game-detail-section strong {
    color: #4a6cd4;
}

/* Hide scroll blip for modals etc. */
body, .modal-content { scrollbar-width: thin; }

@media (max-width: 950px) {
    .container {
        flex-direction: column;
        gap: 0;
    }
    .editor-section, .game-section {
        min-width: unset;
        width: 94vw;
        margin: 0 auto 18px auto;
    }
}

@media (max-width: 700px) {
    .featured-games, .new-games {
        margin: 15px 2vw 8px 2vw;
        padding: 14px 4vw 11px 4vw;
    }
    .container {
        padding: 8px;
    }
    .modal-content {
        width: 95vw;
        padding: 14px 10px 18px 10px;
    }
}